package com.example.springbootlearn.netty.baseasr;

import okhttp3.WebSocket;

import java.util.concurrent.ScheduledFuture;

public abstract class AsrWsbBaseClient {


    protected abstract String getWsUrl(String sessionId);


    protected String getInitialMessage(String sessionId) {
        return null;
    }


    protected abstract WebSocketInfo.CloseStrategy getCloseStrategy();

    public void send(String sessionId, String message) throws InterruptedException {
        // 实现发送逻辑
    }

    public WebSocketInfo createWebSocketInfo(WebSocket webSocket, int needCount, ScheduledFuture<?> scheduledFuture) {
        return new WebSocketInfo(webSocket, needCount, scheduledFuture, getCloseStrategy());
    }
}
